/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gestion;

import java.util.Calendar;
import javax.servlet.http.Cookie;
/**
 *
 * @author p0704327
 */
public class GestionCookie {

    public static Cookie getCookie(Cookie[] cookies, String cookieCherche){

        if(cookies != null){

            //recherche du bon cookie
            for(int i = 0; i < cookies.length; i++) {
                if (cookies[i].getName().equals(cookieCherche))
                    return cookies[i];
            }
        }
        return null;
    }
}
